﻿
<%@ Page Language="C#" Theme="Default" MasterPageFile="~/MasterPages/admin.master" AutoEventWireup="true"  CodeFile="SanPhamDanhMucEdit.aspx.cs" Inherits="Indeco.G24.Website.Admin.SanPhamDanhMucEdit" Title="SanPhamDanhMuc Edit" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">San Pham Danh Muc - Add/Edit</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:MultiFormView ID="FormView1" DataKeyNames="IDSanPhamDanhMuc" runat="server" DataSourceID="SanPhamDanhMucDataSource">
		
			<EditItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/SanPhamDanhMucFields.ascx" />
			</EditItemTemplatePaths>
		
			<InsertItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/SanPhamDanhMucFields.ascx" />
			</InsertItemTemplatePaths>
		
			<EmptyDataTemplate>
				<b>SanPhamDanhMuc not found!</b>
			</EmptyDataTemplate>
			
			<FooterTemplate>
				<asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
				<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
				<asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
			</FooterTemplate>

		</data:MultiFormView>
		
		<data:SanPhamDanhMucDataSource ID="SanPhamDanhMucDataSource" runat="server"
			SelectMethod="GetByIDSanPhamDanhMuc"
		>
			<Parameters>
				<asp:QueryStringParameter Name="IDSanPhamDanhMuc" QueryStringField="IDSanPhamDanhMuc" Type="String" />

			</Parameters>
		</data:SanPhamDanhMucDataSource>
		
		<br />

		<asp:Panel ID="SanPhamPanel2" runat="server" CssClass="collapsePanelHeader"> 
			<div style="padding:5px; cursor: pointer; vertical-align: middle;">
				<div style="float: left; vertical-align: middle;"><asp:Image ID="SanPhamImage" runat="server" ImageUrl="~/images/expand_blue.jpg"/></div>
				<div style="float: left; padding-left: 5px;">San Pham Details</div>
				<div style="float: left; margin-left: 20px;"><asp:Label ID="SanPhamLabel" runat="server" /></div>
			</div>
		</asp:Panel>	
		<asp:Panel ID="SanPhamPanel1" runat="server" CssClass="collapsePanel" Height="0">
		<data:EntityGridView ID="GridViewSanPham" runat="server"
			AutoGenerateColumns="False"					
			OnSelectedIndexChanged="GridViewSanPham_SelectedIndexChanged"			 			 
			DataSourceID="SanPhamDataSource"
			DataKeyNames="IDSanPham"
			AllowMultiColumnSorting="false"
			DefaultSortColumnName="" 
			DefaultSortDirection="Ascending"	
			ExcelExportFileName="Export_SanPham.xls"  		
			Visible='<%# (FormView1.DefaultMode == FormViewMode.Insert) ? false : true %>'	
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" />
				<asp:BoundField DataField="Ten" HeaderText="Ten" SortExpression="Ten" />				
				<asp:BoundField DataField="MoTa" HeaderText="Mo Ta" SortExpression="MoTa" />				
				<asp:BoundField DataField="NhaSanXuat" HeaderText="Nha San Xuat" SortExpression="NhaSanXuat" />				
				<asp:BoundField DataField="DonViTinh" HeaderText="Don Vi Tinh" SortExpression="DonViTinh" />				
				<asp:BoundField DataField="HinhMinhHoa" HeaderText="Hinh Minh Hoa" SortExpression="HinhMinhHoa" />				
				<asp:BoundField DataField="TrangThai" HeaderText="Trang Thai" SortExpression="TrangThai" />				
				<asp:BoundField DataField="ViTri" HeaderText="Vi Tri" SortExpression="ViTri" />				
				<asp:BoundField DataField="SoLanXem" HeaderText="So Lan Xem" SortExpression="SoLanXem" />				
				<asp:BoundField DataField="ThoiDiemChinhSua" HeaderText="Thoi Diem Chinh Sua" SortExpression="ThoiDiemChinhSua" />				
				<asp:BoundField DataField="ThoiDiemCapNhat" HeaderText="Thoi Diem Cap Nhat" SortExpression="ThoiDiemCapNhat" />				
			</Columns>
			<EmptyDataTemplate>
				<b>No San Pham Found! </b>
				<asp:HyperLink runat="server" ID="hypSanPham" NavigateUrl="~/admin/SanPhamEdit.aspx">Add New</asp:HyperLink>
			</EmptyDataTemplate>
		</data:EntityGridView>					
		
		<data:SanPhamDataSource ID="SanPhamDataSource" runat="server" SelectMethod="Find">
		    <Parameters>
				<data:SqlParameter Name="Parameters">
					<Filters>
						<data:SanPhamFilter  Column="IDSanPhamDanhMuc" QueryStringField="IDSanPhamDanhMuc" /> 
					</Filters>
				</data:SqlParameter>
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" /> 
		    </Parameters>
		</data:SanPhamDataSource>		
		
		<br />
		</asp:Panel>
		
<ajaxToolkit:CollapsiblePanelExtender ID="cpeSanPham" runat="Server" TargetControlID="SanPhamPanel1"
            ExpandControlID="SanPhamPanel2" CollapseControlID="SanPhamPanel2" Collapsed="True"
            TextLabelID="SanPhamLabel" ExpandedText="(Hide Details...)" CollapsedText="(Show Details...)"
            ImageControlID="SanPhamImage" ExpandedImage="~/images/collapse_blue.jpg" CollapsedImage="~/images/expand_blue.jpg"
            SuppressPostBack="true"/>


</asp:Content>

